<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="java.util.*,com.sms.user.*,com.sms.DB.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
	+ request.getServerName() + ":" + request.getServerPort()
	+ path + "/";
%>

<%
	//清除内存
	response.setHeader("Pragma","No-cache"); 
	response.setHeader("Cache-Control","no-cache"); 
	response.setDateHeader("Expires", 0);
	String userno=(String)session.getAttribute("userno");
	List<Teacher> list=User.getTeacherInfo(userno);
	Teacher teacher=list.get(0);
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>个人信息管理</title>

<script type="text/javascript" src="../easyui/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css" />
<link rel="stylesheet" type="text/css"
	href="../easyui/themes/default/easyui.css" />
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.modyfies {
	display: none;
}
</style>
</head>

<body>

	<div style="top:100px;left:150px;position:relative">
		<fieldset style="height:300px; width:350px">
			&nbsp;
			<legend>可修改信息</legend>
			<p class="tip">点击修改按钮，可直接编辑修改信息，修改后提交即可</p>
			<form id="teacherinfomod" method="post">
				<input type="hidden" name="fromID" value="<%%>" /> <input
					type="hidden" name="role" value="laoshi" />
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td><label for="name">姓名：：</label></td>
						<td style="text-align:left;"><input class="modify"
						class="aaa"	name="name" id="name" value="<%=teacher.getTname()%>"
							style="min-width:200px;" /></td>
					</tr>
					<tr>
						<td><label for="grade">编号：</label></td>
						<td style="text-align:left;"><input class="modify"
						class="aaa"	type="text" name="sno" value="<%=teacher.getTno()%>"
							style="min-width:200px;" /></td>
					</tr>

					<tr>
						<td><label>性别：</label></td>
						<td style="text-align:left;"><input type="hidden" id="sex"
							value="<%=teacher.getSex()%>" />
							<center>
								<input class="aaa" type="radio" name="sex" value="男" id="nan" />
								男 <input class="aaa" name="sex" type="radio" value="女" id="nv" />
								女
							</center></td>

					</tr>
					<tr>
						<td><label>密码：</label></td>
						<td style="text-align:left;"><input class="aaa"
							type="password" value="<%=teacher.getPassword()%>" name="passkey"
							id="file" style="min-width:200px;" /></td>
						<td style="color:#F00;"><input type="button" id="modifyb"
							value="修改密码" />
						</td>
					</tr>
					<tr class="modifies" style="display:none;">
						<td><label>初始密码：</label></td>
						<td style="text-align:left;"><input type="password"
							name="oripsw" id="file" style="min-width:200px;" /></td>

					</tr>
					<tr class="modifies" style="display:none;">
						<td><label>新密码：</label></td>
						<td style="text-align:left;"><input type="password"
							name="newpsw" id="file" style="min-width:200px;" /></td>

					</tr>

					<tr>
						<td align="center"><input type="button" id="mod" value="修改"
							style="margin-top:10px;" /></td>
						<td align="center"><input type="submit" id="submit"
							value="提交" style="margin-top:10px;" /></td>
					</tr>
				</table>
			</form>
		</fieldset>
	</div>
	<script type="text/javascript">
		$(document).ready(
				function() {
					var sex = $("#sex").val();
					if (sex == "女") {
						$("#nv").attr('checked', "checked");
						//alert("hgfhdhj");
					} else {
						//alert("hgfhdhj");
						$("#nan").attr('checked', "checked");
					}

					$("#modifyb").click(function() {
						$(".modifies").show();
					});
					$(".modify").attr('readonly', "readonly");
					$("#mod").click(function() {
						$(".modify").removeAttr('readonly');
						$(".aaa").attr('readonly', "readonly");
					});


					$('#teacherinfomod').submit(
							function(event) {
								event.preventDefault();
                                var str = "hjdfhuhuh";
								alert(str);
								
								var formValue = $(this).serialize();
								$.post('personalinfo_manage/modifyinfo.jsp',
										formValue, function(data) {
											alert(data[0].text);

										}, 'json');
							});
				})
	</script>

</body>
</html>
